package tp.badugi.bot;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class CardValuationTest {
	
	private BotCardInformationProvider botCardInformationProvider;
	
	@Before
	public void before() throws Exception {
		this.botCardInformationProvider = new BotCardInformationProvider();
	}
	
	@After
	public void after() throws Exception {
	}
	
	
	// ----------------------------- Duplicate Exchange ------------------------------
	// Duplicate Color
	
	//2
	@Test
	public void Duplicate_Exchange_Given_AS_KS_3C_6D_Expected_1418(){
		String givenCards[] = new String[]{"AS","KS","3C","6D"};
		int expectedResult = 1418;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	
	@Test
	public void Duplicate_Exchange_Given_4D_8H_9S_6S_Expected_1086(){
		String givenCards[] = new String[]{"4D","8H","9S","6S"};
		int expectedResult = 1086;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	
	@Test
	public void Duplicate_Exchange_Given_5D_QH_AS_6D_Expected_1392(){
		String givenCards[] = new String[]{"5D","QH","AS","6D"};
		int expectedResult = 1392;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	//2
	
	//3
	@Test
	public void Duplicate_Exchange_Given_6D_7H_TH_9H_Expected_87(){
		String givenCards[] = new String[]{"6D","7H","TH","9H"};
		int expectedResult = 87;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	//3
	
	//2+2
	@Test
	public void Duplicate_Exchange_Given_7S_2C_8S_6C_Expected_127(){
		String givenCards[] = new String[]{"7S","2C","8S","6C"};
		int expectedResult = 127;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	
	@Test
	public void Duplicate_Exchange_Given_2H_8C_5H_4C_Expected_130(){
		String givenCards[] = new String[]{"2H","8C","5H","4C"};
		int expectedResult = 130;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	//2+2
	
	//4
	@Test
	public void Duplicate_Exchange_Given_2D_QD_3D_AD_Expected_13(){
		String givenCards[] = new String[]{"2D","QD","3D","AD"};
		int expectedResult = 13;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	//4
	// Duplicate Color
	
	// Duplicate Values Different Color
	@Test
	//2
	public void Duplicate_Exchange_Given_5H_QD_QC_4S_Expected_1092(){
		String givenCards[] = new String[]{"5H","QD","QC","4S"};
		int expectedResult = 1092;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	//2
	
	//2+2
	@Test
	public void Duplicate_Exchange_Given_2H_2D_5S_5C_Expected_129(){
		String givenCards[] = new String[]{"2H","2D","5S","5C"};
		int expectedResult = 129;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	//2+2
	
	//3
	@Test
	public void Duplicate_Exchange_Given_AD_AH_AS_QC_Expected_132(){
		String givenCards[] = new String[]{"AD","AH","AS","QC"};
		int expectedResult = 132;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	//3
	
	//4
	@Test
	public void Duplicate_Exchange_Given_2S_2C_2D_2H_Expected_12(){
		String givenCards[] = new String[]{"2S","2C","2D","2H"};
		int expectedResult = 12;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	//4
	// Duplicate Values Different Color
	
	// Two Duplicated Values And Duplicate Colors
	// Inner Color
	@Test
	public void Duplicate_Exchange_Given_4S_4D_3H_5S_Expected_1209(){
		String givenCards[] = new String[]{"4S","4D","3H","5S"};
		int expectedResult = 1209;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	
	@Test
	public void Duplicate_Exchange_Given_3D_9H_KH_9C_Expected_1151(){
		String givenCards[] = new String[]{"3D","9H","KH","9C"};
		int expectedResult = 1151;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	
	@Test
	public void Duplicate_Exchange_Given_9S_9D_3H_5S_Expected_1195(){
		String givenCards[] = new String[]{"9S","9D","3H","5S"};
		int expectedResult = 1195;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	
	// Double Inner Color
	@Test
	public void Duplicate_Exchange_Given_3C_3H_8C_2H_Expected_131(){
		String givenCards[] = new String[]{"3C","3H","8C","2H"};
		int expectedResult = 131;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	
	// Outer Color
	@Test
	public void Duplicate_Exchange_Given_3S_3D_4C_6C_Expected_120(){
		String givenCards[] = new String[]{"3S","3D","4C","6C"};
		int expectedResult = 120;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	// Two Duplicated Values And Duplicate Colors
	
	// Three Duplicated Values And Duplicate Colors
	@Test
	public void Duplicate_Exchange_Given_AD_AH_AS_QS_Expected_132(){
		String givenCards[] = new String[]{"AD","AH","AS","QS"};
		int expectedResult = 132;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
	// Three Duplicated Values And Duplicate Colors
	// ----------------------------- Duplicate Exchange ------------------------------
	
	@Test
	public void Best_Badugi_Given_AC_2D_3H_4S_Expected_14320(){
		String givenCards[] = new String[]{"AC","2D","3H","4S"};
		int expectedResult = 14320;
		
		int botResult = this.botCardInformationProvider.getValueOfCardsInHand(givenCards);
		
		assertEquals(expectedResult, botResult);
	}
}
